<template>
    <div>
      <h2>监听器</h2>
      <input type="text" v-model.lazy="uname">
      <span>{{msg}}</span>
    </div>
</template>

<script>
import axios from 'axios'
export default {
  data() {
    return {
       uname:'ls',
       msg:''
    }
  },
  watch:{
     uname:{
       async handler(newVal) {
        // console.log(newVal)
        const{data:res}=await axios.get('http://www.itcbc.com:3006/api/finduser/'+newVal)
         this.msg = res.message
}
    }
  }

}
</script>

<style>

</style>